<div id="page-wrapper" class="gray-bg dashbard-1">
    <input type="hidden" id="outpatientNameValue" value="${outpatientName}">
    <input type="hidden" id="userName" value="${userName}">
    <input type="hidden" id="passWord" value="${passWord}">

    <div class="row navbar-static-top">
        <div class="row border-bottom col-sm-2">
            <nav class="navbar col-sm-6" role="navigation" style="margin-bottom: 0;min-height: 39px;">
                <div class="navbar-header" style="width: 100%;">
                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#">
                    </a>
                    <form role="search" class="navbar-form-custom" method="post" action="search_results.html">
                        <div class="form-group">
                        </div>
                    </form>
                </div>
            </nav>
            @if(shiro.hasPermission("/non/market")){
            <!--<label class="col-sm-4 btn addBtn addBtn_x2">切换门诊</label>-->
            <div class="col-sm-6 addBtn_y2" style="padding: 0;">
                <select class="form-control" style="height: 40px;background: #ebebeb;border: 1px solid #ebebeb" id="outpatientNamed" name="outpatientNamed">
                </select>
            </div>
            @}
        </div>
        <div class="row content-tabs col-sm-10" style="padding: 0;">
            <nav class="page-tabs J_menuTabs" style="margin-left: 65px;">
                <div class="page-tabs-content">
                    <a style="display: inline-block;width: 0;padding: 0" href="javascript:;" class="active J_menuTab"
                       data-id="${ctxPath}/blackboard"></a>
                </div>
            </nav>
            <button class="roll-nav roll-left J_tabLeft">
                <i class="fa fa-backward" style="color: #775C85"></i>
            </button>
            <button class="roll-nav roll-right J_tabRight">
                <i class="fa fa-forward" style="color: #775C85"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right" style="left: 0;">
                    <li class="J_tabShowActive"><a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a href="logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
        </div>
    </div>

    <div class="row J_mainContent" id="content-main">
        <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${ctxPath}/blackboard" frameborder="0"
                data-id="${ctxPath}/blackboard"></iframe>
    </div>
    <div class="footer" style="display: none">
        <div class="pull-right"><a href="javaScript:;">&copy; 咿呀口腔</a>
        </div>
    </div>
</div>
<script>
    //初始化下拉到店门诊列表
    var txt;
    var userName = $('#userName').val();
    var passWord = $('#passWord').val();
    $.ajax({
        url: "${ctxPath}/outpatientManagement/getLists",
        type: "post",
        data: {
            "userName": userName
        },
        success: function (data) {
            for (var i = 0; i < data.length; i++) {
                txt += '<option value="' + data[i].simplename + '">' + data[i].simplename + '</option>';
            }
            document.getElementById('outpatientNamed').innerHTML = txt;
            var seleteooutpatientName = $('#outpatientNameValue').val();
            if (seleteooutpatientName != "") {
                $("#outpatientNamed option[value=" + seleteooutpatientName + "]").attr("selected", "selected");
            }
        },
        error: function (data) {
            alert('账户,密码或验证码错误，请稍后再试!');
            window.location.href = "${ctxPath}/login";
        }
    });
    $("#outpatientNamed").change(function () {
        var outpatientName = $('#outpatientNamed').val();
        $.ajax({
            url: "${ctxPath}/login",
            type: "post",
            data: {
                //                "kaptcha": kaptcha,
                "username": userName,
                "outpatientName": outpatientName,
                "password": passWord
            },
            success: function (data) {
                window.location.href = "${ctxPath}/index";
            },
            error: function (data) {
                alert('账户,密码或验证码错误，请稍后再试!');
                window.location.href = "${ctxPath}/login";
            }
        });
    });

</script>
